$(function () {
	window(function () {
		    document.getElementById('chooseId').addEventListener('change', function () {
		      var selectedNum = document.getElementById('chooseId').selectedIndex
		      if (selectedNum === 0) {
		        var barData1 = {}
		        barData1.xAxisData = ['2018-01', '2018-02', '2018-03', '2018-04', '2018-05', '2018-06', '2018-07', '2018-08', '2018-09', '2018-10', '2018-11', '2018-12']
		        barData1.seriesData = []
		        barData1.seriesData.push({
		          type: 'line',
		          data: [120, 140, 100, 120, 300, 230, 130, 170, 140, 120, 300, 230]
		        })
		        createLine(document.getElementById('main'), barData1)
		      } else if (selectedNum === 1) {
		        var barData2 = {}
		        barData2.xAxisData = ['2018-01', '2018-02', '2018-03', '2018-04', '2018-05', '2018-06', '2018-07', '2018-08', '2018-09', '2018-10', '2018-11', '2018-12']
		        barData2.seriesData = []
		        barData2.seriesData.push({
		          type: 'line',
		          data: [200, 120, 300, 200, 170, 300, 200, 180, 200, 190, 300, 200]
		        })
		        createLine(document.getElementById('main'), barData2)
		      } else if (selectedNum === 2) {
		        var barData3 = {}
		        barData3.xAxisData = ['2018-01', '2018-02', '2018-03', '2018-04', '2018-05', '2018-06', '2018-07', '2018-08', '2018-09', '2018-10', '2018-11', '2018-12']
		        barData3.seriesData = []
		        barData3.seriesData.push({
		          type: 'line',
		          data: [100, 200, 140, 300, 200, 180, 100, 300, 230, 130, 100, 300]
		        })
		        createLine(document.getElementById('main'), barData3)
		      } else if (selectedNum === 3) {
		        var barData4 = {}
		        barData4.xAxisData = ['2018-01', '2018-02', '2018-03', '2018-04', '2018-05', '2018-06', '2018-07', '2018-08', '2018-09', '2018-10', '2018-11', '2018-12']
		        barData4.seriesData = []
		        barData4.seriesData.push({
		          type: 'line',
		          data: [120, 140, 100, 120, 300, 230, 130, 170, 140, 120, 300, 230]
		        },
		          {
		            type: 'line',
		            data: [200, 120, 300, 200, 170, 300, 200, 180, 200, 190, 300, 200]
		          },
		          {
		            type: 'line',
		            data: [100, 200, 140, 300, 200, 180, 100, 300, 230, 130, 100, 300]
		          })
		        createLine(document.getElementById('main'), barData4)
		      }
		    })
		    var barData1 = {}
		    barData1.xAxisData = ['2018-01', '2018-02', '2018-03', '2018-04', '2018-05', '2018-06', '2018-07', '2018-08', '2018-09', '2018-10', '2018-11', '2018-12']
		    barData1.seriesData = []
		    barData1.seriesData.push({
		      type: 'line',
		      data: [120, 140, 100, 120, 300, 230, 130, 170, 140, 120, 300, 230]
		    })
		    createLine(document.getElementById('main'), barData1)
		  })();
		  function createLine(el, opt) {
		    var myChart = echarts.init(el)
		    var xAxisData = opt.xAxisData
		    var seriesData = opt.seriesData
		    var option = {
		      title: {
		        text: 'title',
		        textAlign: 'left',
		        textStyle: { color: '#fff', fontSize: '16', fontWeight: 'normal' }
		      },
		      color: ['#036BC8', '#4A95FF', '#5EBEFC', '#2EF7F3', '#FFFFFF'],
		      grid: {
		        left: '2%',
		        top: '12%',
		        bottom: '5%',
		        right: '5%',
		        containLabel: true
		      },
		      tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
		      xAxis: [
		        {
		          type: 'category',
		          axisLine: { show: true, lineStyle: { color: '#6173A3' } },
		          axisLabel: {
		            interval: 0,
		            textStyle: { color: '#9ea7c4', fontSize: 14 }
		          },
		          axisTick: { show: false },
		          data: xAxisData
		        }
		      ],
		      yAxis: [
		        {
		          axisTick: { show: false },
		          splitLine: { show: false },
		          axisLabel: { textStyle: { color: '#9ea7c4', fontSize: 14 } },
		          axisLine: { show: true, lineStyle: { color: '#6173A3' } }
		        }
		      ],
		      series: seriesData
		    }
		    myChart.setOption(option, true)
		  }			
})
